<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ice="http://www.icesoft.com/icefaces/component"
      xmlns:composite="http://java.sun.com/jsf/composite">
    <composite:interface>
        <!--        <composite:attribute name="sidDadosTabela"
                                     type="java.lang.String"
                                     default="DadosTabela"
                                     shortDescription='"ID" Tabela Dados'/>-->
        <composite:attribute name="bean"
                             required="true"
                             shortDescription="Bean"/>
        <composite:attribute name="visivel"
                             required="true"
                             shortDescription="Visibilidade janela"/>
        <composite:attribute name="tabelaConfig"
                             required="true"
                             shortDescription="
                             tabelaConfig.sidDadosTabela
                             tabelaConfig.qtdPaginas
                             tabelaConfig.listaRegistros
                             registroLista[coluna.snmCampoColuna]
                             tabelaConfig.colunasTabela
                             coluna.labelColuna

                             tabelaConfig[rowSelectionListener]
                             tabelaConfig[metodoAlterar]
                             tabelaConfig[metodoExcluir]
                             "/>
        <composite:attribute name="salvar"
                             required="false"
                             shortDescription="Metodo a chamar ao clicar em Salvar"
                             default="salvar"/>
        <composite:attribute name="excluir"
                             required="false"
                             shortDescription="Metodo a chamar ao clicar em Excluir"
                             default="excluir"/>
        <composite:attribute name="cancelar"
                             required="false"
                             shortDescription="Metodo a chamar ao clicar em Cancelar"
                             default="cancelar"/>
    </composite:interface>
    <composite:implementation>
        <ice:form id="#{cc.attrs.idForm}">
            <ice:panelPopup draggable="false" modal="true" visible="#{cc.attrs.visivel}" rendered="#{cc.attrs.visivel}" autoCentre="true">
                <f:facet name="body">
                    <ice:panelGrid cellpadding="0" cellspacing="0" styleClass="tableBodyPopupCad" headerClass="headPopupCad" footerClass="footPopupCad" columns="1">
                        <f:facet name="header">
                            <ice:panelGroup>
                                <ice:outputText value="#{tipoDocumentoCad.sdcTituloTelaCad}"/>
                            </ice:panelGroup>
                        </f:facet>
                        <ice:panelGrid columns="4" styleClass="toolbarCad" columnClasses="nothing,nothing,width100,nothing">
                            <ice:commandButton actionListener="${cc.attrs.bean[cc.attrs.salvar]}" styleClass="buttonsCad buttonSave" title="#{mLbl['botao.salvar']}"/>
                            <ice:commandButton actionListener="${cc.attrs.bean[cc.attrs.excluir]}" styleClass="buttonsCad buttonExcluir" rendered="#{!cc.attrs.bean['tabelaConfigPricipalCad']['novoReg']}" title="#{mLbl['botao.excluir']}"/>
                            <ice:panelGroup/>
                            <ice:commandButton actionListener="#{cc.attrs.bean[cc.attrs.cancelar]}" styleClass="buttonsCad buttonCancelar" title="#{mLbl['botao.cancelar']}"/>
                        </ice:panelGrid>
                        <ice:panelSeries var="campo" value="#{cc.attrs.tabelaConfig.camposTabelaCad}">
                            <ice:panelGrid columns="2" columnClasses="labelCampoCad">
                                <ice:outputText value="${campo.labelCampo}"/>
<!--                            <ice:outputText value="*" style="color: red;" rendered="${campo.requerido}"/>-->
                                
                                <ice:inputText value="#{cc.attrs.tabelaConfig.selected[campo.snmCampo]}" required="${campo.requerido}" maxlength="${campo.length > -1?campo.length:50}"></ice:inputText>
                            </ice:panelGrid>
                        </ice:panelSeries>
                    </ice:panelGrid>
                </f:facet>
            </ice:panelPopup>
        </ice:form>
    </composite:implementation>
</html>
